package com.xncoding.pos.future;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * @ author mr
 * @ description
 * @ since 2024/12/12
 */
public class TransportTemplate {

    public ListenableFuture<String> send(String request){
        SettableFuture<String> future = SettableFuture.create();

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        future.set(request + "hahah");
        return future;
    }
}
